from com.utils.Dbhelper import Dbhelper

if __name__ == '__main__':
    #获取工具类对象
    # db = Dbhelper("test")
    # # 编写sql
    # sql = "insert into city values(%s,%s,%s)"
    # city = (6,"重庆",1)
    # # 执行sql
    # n = db.update(sql,city)
    # print(n)

    dbHelper =Dbhelper("test")
    sql = "update city set cname =%s where cid =%s"
    params = ("上海",6)
    n = dbHelper.update(sql,params)
    print(n)

    dbHelper = Dbhelper("test")
    sql = "select * from city where cname like %s "
    params = ("%州%")
    result = dbHelper.queryAll(sql,params)
    print(result)